"""
In Python, we can access the property of an object by accessing it as an attribute.
A book object, for example, might have a title property, which we can access by calling book.title.
Columns in a pandas DataFrame work in much the same way.

e.g.
reviews.country


If we have a Python dictionary,
we can access its values using the indexing ([]) operator.
We can do the same with columns in a DataFrame:

e.g.
reviews['country']

reviews['country'][0]
"""

"""
indexing in pandas

Index-based selection
reviews.iloc[0]
Both loc and iloc are row-first, column-second. 
This is the opposite of what we do in native Python, which is column-first, row-second.

Label-based selection
to get the first entry in reviews, we would now do the following:
 reviews.loc[0, 'country']
 
 reviews.loc[:, ['taster_name', 'taster_twitter_handle', 'points']]
"""

"""
conditional selection
reviews.loc[reviews.country == 'Italy']
reviews.loc[(reviews.country == 'Italy') & (reviews.points >= 90)]
reviews.loc[(reviews.country == 'Italy') | (reviews.points >= 90)]
reviews.loc[reviews.country.isin(['Italy', 'France'])]

isnull (and its companion notnull)
reviews.loc[reviews.price.notnull()]
"""

"""
assigning data
reviews['critic'] = 'everyone'

reviews['index_backwards'] = range(len(reviews), 0, -1)
0         129971
1         129970
           ...  
129969         2
129970         1
Name: index_backwards, Length: 129971, dtype: int64
"""